﻿using Abp.Application.Services.Dto;
using Choucius.Boilerplate9.Controllers;
using Choucius.Boilerplate9.WorkStations;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;

namespace Choucius.Boilerplate9.Web.Controllers
{
    public class WorkStationsController : Boilerplate9ControllerBase
    {
        private readonly IWorkStationAppService _workStationAppService;

        /// <summary>
        /// 依赖注入
        /// </summary>
        /// <param name="workStationAppService"></param>
        public WorkStationsController(IWorkStationAppService workStationAppService)
        {
            _workStationAppService = workStationAppService;
        }

        public IActionResult Index()
        {
            //var input = new PagedResultRequestDto();
            //var result = _workStationAppService.GetAllAsync(input);
            //var userDtos = ObjectMapper.Map<List<WorkStationDto>>(result);
            return View();
        }

        public async Task<ActionResult> EditModal(Guid workStationId)
        {
            var output = await _workStationAppService.GetAsync(new EntityDto<Guid>(workStationId));
            //var model = ObjectMapper.Map<EditRoleModalViewModel>(output);
            return PartialView("_EditModal", output);
        }
    }
}
